//package com.rw.dao.Impl;
//
//import com.rw.dao.AccountDao;
//import com.rw.dao.base.BaseDao;
//import com.rw.pojo.Account;
//
//import java.sql.ResultSet;
//import java.sql.SQLException;
//
///**
// * @author rabit
// */
//public class AccountDaoImpl extends BaseDao implements AccountDao{
//
//
////    @Override
////    public Account getAccount(int aid, String apwd) throws SQLException {
////        //构建sql
////        String sql =  "SELECT aid,apwd,money,uid FROM t_account WHERE aid = "+aid+" AND apwd ='"+apwd+"';";
////        //进行查询方法
////        ResultSet resultSet = dataSource.selectData(sql);
////        Account account = null;
////        if (resultSet.next()){
////            account =  new Account();
////            account.setAid(resultSet.getInt("aid"));
////            account.setApwd(resultSet.getString("apwd"));
////            account.setMoney(resultSet.getDouble("money"));
////            account.setUid(resultSet.getInt("uid"));
////        }
////        return account;
////    }
//
////    @Override
////    public Account getAccountByAid(Integer aid) throws SQLException {
////        //构建sql
////        String sql =  "SELECT aid,apwd,money,uid FROM t_account WHERE aid = "+aid+"";
////        //进行查询方法
////        ResultSet resultSet = dataSource.selectData(sql);
////        Account account = null;
////        if (resultSet.next()){
////            account =  new Account();
////            account.setAid(resultSet.getInt("aid"));
////            account.setApwd(resultSet.getString("apwd"));
////            account.setMoney(resultSet.getDouble("money"));
////            account.setUid(resultSet.getInt("uid"));
////        }
////        return account;
////    }
//
//    @Override
//    public Account getAccountByAidAndMoney(Integer aid, Double money) throws SQLException {
//        //构建sql
//        String sql =  "SELECT aid,apwd,money,uid FROM t_account WHERE aid = "+aid+" and money &gt;"+ money;
//        //进行查询方法
//        ResultSet resultSet = dataSource.selectData(sql);
//        Account account = null;
//        if (resultSet.next()){
//            account =  new Account();
//            account.setAid(resultSet.getInt("aid"));
//            account.setApwd(resultSet.getString("apwd"));
//            account.setMoney(resultSet.getDouble("money"));
//            account.setUid(resultSet.getInt("uid"));
//        }
//        return account;
//    }
//
//    @Override
//    public Account getInAccount(Integer inUid, String inUname) throws SQLException {
//        //构建sql
//        String sql =  "SELECT t_account.* FROM t_account LEFT JOIN t_user ON t_account.uid = t_user.uid WHERE t_account.uid= "+inUid+" AND t_user.uname ='"+inUname+"'";
//        //进行查询方法
//        ResultSet resultSet = dataSource.selectData(sql);
//        Account account = null;
//        if (resultSet.next()){
//            account =  new Account();
//            account.setAid(resultSet.getInt("aid"));
//            account.setApwd(resultSet.getString("apwd"));
//            account.setMoney(resultSet.getDouble("money"));
//            account.setUid(resultSet.getInt("uid"));
//        }
//        return account;
//    }
//
////    @Override
////    public int changeMoney(Integer aid, Double money) throws SQLException {
////        String sql = "UPDATE t_account SET money=money+"+money+" WHERE aid ="+aid;
////        System.out.println(sql);
////        int num = dataSource.updateData(sql);
////        return num;
////    }
//
////    @Override
////    public Account getAccountByUid(Integer uid) throws SQLException {
////        //构建sql
////        String sql =  "SELECT aid,apwd,money,uid FROM t_account WHERE uid = "+uid+"";
////        //进行查询方法
////        ResultSet resultSet = dataSource.selectData(sql);
////        Account account = null;
////        if (resultSet.next()){
////            account =  new Account();
////            account.setAid(resultSet.getInt("aid"));
////            account.setApwd(resultSet.getString("apwd"));
////            account.setMoney(resultSet.getDouble("money"));
////            account.setUid(resultSet.getInt("uid"));
////        }
////        return account;
////    }
//}
